package com.coffee.netty.connection;


import com.coffee.netty.RpcCodec;
import io.netty.channel.ChannelHandler;

/**
 * Factory that creates connections.
 * @author songkui
 * @since 2021/7/31
 */
public interface ConnectionFactory {

    void connect(Connection connection) throws Exception;

    void registerRpcCodec(RpcCodec rpcCodec);

    void registerCommandHandler(ConnectionCommandHandler commandHandler);

    // is not must
    void registerHeartbeatHandler(ChannelHandler heatHandler);

    void setHeartSecond(long heartTime);

    /**
     * Initialize the factory.
     */
    void init();

    }
